package com.shujia.wyh.day16;

/*
        遍历获取字符串中的每一个字符
 */
public class StringTest1 {
    public static void main(String[] args) {
        String s = "bigdatajava";
        //将字符串转成字符数组
        char[] chars = s.toCharArray();
        for(int i=0;i<chars.length;i++){
            if(i==0){
                System.out.print("["+chars[i]+",");
            }else if(i==chars.length-1){
                System.out.print(chars[i]+"]");
            }else {
                System.out.print(chars[i]+",");
            }
        }
    }
}
